/*
 * @Author: liu_lizhi
 * @Date: 2021-03-18 15:51:04
 * @LastEditTime: 2021-04-07 16:22:45
 * @Description: base64转为图片
 */
cordova.define("org.ginnjea.convImg.Base64ToImg", function(require, exports, module){
    var exec = require("cordova/exec");
    
    var Base64ToImg = {
        saveImage: function (b64String, fileName, successCallback, failCallback)
        {
            function success(args) {
                if (typeof successCallback === 'function')
                    successCallback(args);
            }

            function fail(args) {
                if (typeof failCallback === 'function')
                    failCallback(args);
            }
            
            return exec(
                function (args) { success(args); },
                function (args) { fail(args); },
                'Base64ToImg',
                'saveImage',
                [b64String,fileName]);
        }
    }
    module.exports = Base64ToImg;
});
